package com.april.pattern.creational.prototype;

import java.io.Serializable;
import java.util.Date;

/**
 * @author April
 * @version V1.0.0
 * @date 2019/06/23 13:13
 * @description
 */
public class SheepOne implements Cloneable, Serializable {
    private String name;
    private Date birthday;

    public SheepOne(String name, Date birthday) {
        this.name = name;
        this.birthday = birthday;
    }

    /**
     * 浅复制
     *
     * @return SheepOne
     * @throws CloneNotSupportedException CloneNotSupportedException
     */
    @Override
    protected Object clone() throws CloneNotSupportedException {
        // 直接调用父类的克隆方法
        return super.clone();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}
